package Designpatterns.Dao;

import org.junit.Test;

public class NewsTest {
    @Test
    public void test1(){
        NewsDao dao = SimpleDaoFactory.getInstance("mysql");
        NewsServiceImpl service = new NewsServiceImpl();
        service.setDao(dao);
    }
    @Test
    public void test2(){
        MySqlDaoFactory mySqlDaoFactory = new MySqlDaoFactory();
        NewsDao dao = mySqlDaoFactory.getInstance();
        NewsServiceImpl service = new NewsServiceImpl();
        service.setDao(dao);
    }
}
